﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StuInfo.aspx.cs" Inherits="StuClassInfo.StuInfo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="jquery-1.11.3.js"></script>
    <script>
        $(function () {
            $(".del").click(function () {
                //获取删除的ID
                var id = $(this).attr("delid");
                $.get("/Ajax/StuHandler.ashx", { id: id }, function (data) {
                    if (data.State == 1) {
                        alert(data.Message);
                        location.reload();
                    }
                    else {
                        alert(data.Message);
                    }
                }, "json");
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server" style="width: 800px; margin: 0 auto">
        <div style="width: 100%">
            <table>
                <tr>
                    <td>编号</td>
                    <td>姓名</td>
                    <td>年龄</td>
                    <td>手机</td>
                    <td>邮箱</td>
                    <td>班级</td>
                    <td>操作</td>
                </tr>
                <asp:Repeater ID="Repeater_stu" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td><%# Eval("userid") %></td>
                            <td><%# Eval("username") %></td>
                            <td><%# Eval("userage") %></td>
                            <td><%# Eval("userphone") %></td>
                            <td><%# Eval("userEmail") %></td>
                            <td><%# Eval("classname") %></td>
                            <td>
                                <a href='UpdateStu.aspx?userid=<%# Eval("userid") %>' style="background-color:pink; color: yellow; text-decoration: none">修改</a>
                                <a class="del" delid='<%# Eval("userid")%>' style="background-color:pink; color: yellow; text-decoration: none">删除</a>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <asp:Button Text="添加" PostBackUrl="~/ADDstu.aspx" runat="server" BackColor="yellow" ForeColor="White" />
        </div>
    </form>
</body>
</html>
